import json


def common_assert(resp, status_code, success, code, message):
    assert status_code == resp.status_code
    assert success is resp.json().get("success")
    assert code == resp.json().get("code")
    assert message in resp.json().get("message")


def read_json_data(filename):
    with open(filename, "r", encoding="utf8") as f:
        json_data = json.load(f)
        data_list = []
        for data in json_data:
            val = data.values()
            tmp = tuple(val)
            data_list.append(tmp)
        # 必须返回，不能在 for 内
        return data_list
